import { Behaviour, GameObject, getGameObjectById, core } from "../gameengine";
import { user } from "../user";
import { firstUI1, firstUI7, firstUI6, firstUI5, firstUI4, firstUI3, firstUI2 } from "../data";

export class shengchengUI extends Behaviour {

    ui1: GameObject;
    ui2: GameObject;
    ui3: GameObject;
    ui4: GameObject;
    ui5: GameObject;
    ui6: GameObject;
    ui7: GameObject;

    protected onStart() {
        if (user.UIdis == false) {
            this.ui7 = core.createPrefab(firstUI7);
            const scene7 = getGameObjectById("duihuaUI");
            scene7.addChild(this.ui7);

            this.ui6 = core.createPrefab(firstUI6);
            const scene6 = getGameObjectById("duihuaUI");
            scene6.addChild(this.ui6);

            this.ui5 = core.createPrefab(firstUI5);
            const scene5 = getGameObjectById("duihuaUI");
            scene5.addChild(this.ui5);

            this.ui4 = core.createPrefab(firstUI4);
            const scene4 = getGameObjectById("duihuaUI");
            scene4.addChild(this.ui4);

            this.ui3 = core.createPrefab(firstUI3);
            const scene3 = getGameObjectById("duihuaUI");
            scene3.addChild(this.ui3);

            this.ui2 = core.createPrefab(firstUI2);
            const scene2 = getGameObjectById("duihuaUI");
            scene2.addChild(this.ui2);

            this.ui1 = core.createPrefab(firstUI1);
            const scene1 = getGameObjectById("duihuaUI");
            scene1.addChild(this.ui1);

            user.UIdis = true;
        }

    }


    protected onUpdate(advancedTime: number) {


    }


}